Skip to content

Merge Develop to Main#11

Merged
youyeon11 merged 32 commits intomainfrom
develop
Aug 27, 2025
Merged

Merge Develop to Main#11
youyeon11 merged 32 commits intomainfrom
develop

Conversation

@youyeon11
Copy link
Contributor

๐Ÿ“Œ ์ž‘์—… ๋ชฉ์ 

  • ์—ฌํƒœ๊นŒ์ง€์˜ ์ž‘์—…์„ main์— merge

youyeon11 and others added 30 commits August 25, 2025 16:52
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @youyeon11, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

์ด PR์€ ๊ฐœ๋ฐœ ๋ธŒ๋žœ์น˜์—์„œ ๋ฉ”์ธ ๋ธŒ๋žœ์น˜๋กœ์˜ ๋ณ‘ํ•ฉ์„ ํ†ตํ•ด AI ๊ธฐ๋ฐ˜ ์•Œ์•ฝ ์‹๋ณ„ ์„œ๋น„์Šค์˜ ํ•ต์‹ฌ ๊ธฐ๋Šฅ์„ ๋„์ž…ํ•ฉ๋‹ˆ๋‹ค. ์ด ์„œ๋น„์Šค๋Š” FastAPI๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌ์ถ•๋˜์—ˆ์œผ๋ฉฐ, Redis ์ŠคํŠธ๋ฆผ์„ ํ†ตํ•ด ๋น„๋™๊ธฐ ์ž‘์—… ์ฒ˜๋ฆฌ๋ฅผ ๊ด€๋ฆฌํ•˜๊ณ , S3์—์„œ ์ด๋ฏธ์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜๋ฉฐ, PyTorch ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜์—ฌ ์•Œ์•ฝ์„ ์‹๋ณ„ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ํ”„๋กœ์ ํŠธ์˜ ์•„ํ‚คํ…์ฒ˜๋ฅผ ํฌ๊ฒŒ ์—…๋ฐ์ดํŠธํ•˜๊ณ  ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•˜๋Š” ์ค‘์š”ํ•œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค.

Highlights

  • AI ๊ธฐ๋ฐ˜ ์•Œ์•ฝ ์‹๋ณ„ ์„œ๋น„์Šค ๋„์ž…: FastAPI๋ฅผ ํ™œ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€๋ฅผ ํ†ตํ•œ ์•Œ์•ฝ ์‹๋ณ„ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
  • ๋น„๋™๊ธฐ ์ž‘์—… ์ฒ˜๋ฆฌ ์‹œ์Šคํ…œ ๊ตฌ์ถ•: Redis ์ŠคํŠธ๋ฆผ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€ ์ฒ˜๋ฆฌ ์ž‘์—…์„ ๋น„๋™๊ธฐ์ ์œผ๋กœ ๊ด€๋ฆฌํ•˜๊ณ , ์ž‘์—… ํ ๋ฐ ๊ฒฐ๊ณผ ์ŠคํŠธ๋ฆผ์„ ํ†ตํ•ด ํšจ์œจ์ ์ธ ์ฒ˜๋ฆฌ๋ฅผ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค.
  • S3 ์—ฐ๋™์„ ํ†ตํ•œ ์ด๋ฏธ์ง€ ์ฒ˜๋ฆฌ: Presigned URL์„ ํ†ตํ•ด S3์—์„œ ์ด๋ฏธ์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜๊ณ  ์ฒ˜๋ฆฌํ•˜๋Š” ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • PyTorch ๋ชจ๋ธ ํ†ตํ•ฉ: LightCNN ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€์—์„œ ์•Œ์•ฝ์„ ์˜ˆ์ธกํ•˜๊ณ  ์‹๋ณ„ํ•˜๋Š” ๋กœ์ง์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.
  • ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ ๋ฐ ์„ค์ • ์—…๋ฐ์ดํŠธ: .github ์ด์Šˆ ํ…œํ”Œ๋ฆฟ, .gitignore ํŒŒ์ผ, README.md๋ฅผ ์—…๋ฐ์ดํŠธํ•˜๊ณ , .idea IDE ์„ค์ • ํŒŒ์ผ์„ ์ œ๊ฑฐํ•˜๋ฉฐ, ์ƒˆ๋กœ์šด app ๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ๋กœ ํŒŒ์ผ์„ ์žฌ๊ตฌ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with ๐Ÿ‘ and ๐Ÿ‘Ž on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. โ†ฉ

@youyeon11 youyeon11 merged commit 1790a22 into main Aug 27, 2025
1 check failed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

์ด PR์€ ๊ธฐ์กด ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ๋ฅผ FastAPI ๊ธฐ๋ฐ˜์˜ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์œผ๋กœ ์žฌ๊ตฌ์„ฑํ•˜๊ณ , Redis Stream์„ ์ด์šฉํ•œ ๋น„๋™๊ธฐ ์ž‘์—… ํ ์‹œ์Šคํ…œ์„ ๋„์ž…ํ•˜๋Š” ๋“ฑ ๋งŽ์€ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ํฌํ•จํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ „๋ฐ˜์ ์œผ๋กœ ์ข‹์€ ๊ตฌ์กฐ๋ฅผ ๊ฐ–์ถ”๊ณ  ์žˆ์ง€๋งŒ, ๋ช‡ ๊ฐ€์ง€ ์ค‘์š”ํ•œ ์ˆ˜์ •์ด ํ•„์š”ํ•ด ๋ณด์ž…๋‹ˆ๋‹ค. ํŠนํžˆ ๋ชจ๋ธ ๋กœ๋”ฉ ์‹œ์˜ ๋ณด์•ˆ ์ทจ์•ฝ์ , ์›Œ์ปค ๋กœ์ง์˜ ๋ฒ„๊ทธ, ์„ค์ • ๊ด€๋ฆฌ ๋ฐฉ์‹ ๋“ฑ์—์„œ ๊ฐœ์„ ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๊ฐ ํŒŒ์ผ์— ๋‚จ๊ธด ์ฝ”๋ฉ˜ํŠธ๋ฅผ ์ฐธ๊ณ ํ•ด ์ฃผ์„ธ์š”.

def _load_model(self, model_path: Path) -> LightCNN:
import __main__
__main__.LightCNN = LightCNN
model = torch.load(model_path, map_location=self.device, weights_only=False)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

torch.load ํ•จ์ˆ˜์— weights_only=False๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์€ ์‹ฌ๊ฐํ•œ ๋ณด์•ˆ ์ทจ์•ฝ์ ์„ ์œ ๋ฐœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์‹ ๋ขฐํ•  ์ˆ˜ ์—†๋Š” ์†Œ์Šค์˜ ๋ชจ๋ธ ํŒŒ์ผ์„ ๋กœ๋“œํ•  ๊ฒฝ์šฐ ์ž„์˜์˜ ์ฝ”๋“œ๊ฐ€ ์‹คํ–‰๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ชจ๋ธ์„ ์ €์žฅํ•  ๋•Œ torch.save(model.state_dict(), PATH)์™€ ๊ฐ™์ด state_dict๋งŒ ์ €์žฅํ•˜๊ณ , ๋กœ๋“œํ•  ๋•Œ๋Š” model = TheModelClass(*args, **kwargs)๋กœ ๋ชจ๋ธ ์ธ์Šคํ„ด์Šค๋ฅผ ๋จผ์ € ์ƒ์„ฑํ•œ ๋’ค model.load_state_dict(torch.load(PATH))๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒƒ์ด ์•ˆ์ „ํ•˜๊ณ  ๊ถŒ์žฅ๋ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ์˜ __main__ ์˜์กด์„ฑ ๋ฌธ์ œ๋„ ํ•จ๊ป˜ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.


import asyncio
import redis.asyncio as redis
from app.core.config import Settings

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Settings ํด๋ž˜์Šค๋ฅผ importํ•˜๊ณ  ์žˆ์ง€๋งŒ, ์ฝ”๋“œ์—์„œ๋Š” settings ์ธ์Šคํ„ด์Šค๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. from app.core.config import settings๋กœ ์ˆ˜์ •ํ•ด์•ผ NameError๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Suggested change
from app.core.config import Settings
from app.core.config import settings

Comment on lines +31 to +33
await process_image_scan(job, redis_client)
# ์ฒ˜๋ฆฌ ์„ฑ๊ณต ์‹œ์—๋งŒ ack
await redis_client.xack(settings.STREAM_JOB, settings.GROUP_NAME, msg_id)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

run ๋ฉ”์†Œ๋“œ ๋‚ด์—์„œ redis_client ๋ณ€์ˆ˜๊ฐ€ ์ •์˜๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ํด๋ž˜์Šค ์ธ์Šคํ„ด์Šค์˜ redis ํด๋ผ์ด์–ธํŠธ๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋ฏ€๋กœ self.redis_client๋กœ ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด NameError๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

Suggested change
await process_image_scan(job, redis_client)
# ์ฒ˜๋ฆฌ ์„ฑ๊ณต ์‹œ์—๋งŒ ack
await redis_client.xack(settings.STREAM_JOB, settings.GROUP_NAME, msg_id)
await process_image_scan(job, self.redis_client)
# ์ฒ˜๋ฆฌ ์„ฑ๊ณต ์‹œ์—๋งŒ ack
await self.redis_client.xack(settings.STREAM_JOB, settings.GROUP_NAME, msg_id)

REDIS_URL: str = os.environ.get("REDIS_SERVER_URL", "redis://localhost:6379")
S3_REGION: str = os.environ.get("S3_REGION", "ap-northeast-2")
S3_ENDPOINT_URL: str | None = os.environ.get("S3_ENDPOINT_URL")
BUCKET_NAME: str = os.environ.get("BUCKET_NAME")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

BUCKET_NAME ํ™˜๊ฒฝ ๋ณ€์ˆ˜๊ฐ€ ์„ค์ •๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ os.environ.get("BUCKET_NAME")์€ None์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ํƒ€์ž…์€ str๋กœ ์ง€์ •๋˜์–ด ์žˆ์–ด None์ด ํ• ๋‹น๋  ๊ฒฝ์šฐ Pydantic ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๋‚˜ ๋Ÿฐํƒ€์ž„์—์„œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. BUCKET_NAME์ด ํ•„์ˆ˜ ์„ค์ •์ด๋ผ๋ฉด os.environ.get์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  BUCKET_NAME: str๋กœ ์„ ์–ธํ•˜์—ฌ, ํ™˜๊ฒฝ ๋ณ€์ˆ˜๊ฐ€ ์—†์„ ๋•Œ Pydantic์ด ์‹œ์ž‘ ์‹œ์ ์— ์˜ค๋ฅ˜๋ฅผ ๋ฐœ์ƒ์‹œํ‚ค๋„๋ก ํ•˜๋Š” ๊ฒƒ์ด ๋” ์•ˆ์ „ํ•ฉ๋‹ˆ๋‹ค.

Suggested change
BUCKET_NAME: str = os.environ.get("BUCKET_NAME")
BUCKET_NAME: str

Comment on lines +1 to +18
import redis
from dotenv import load_dotenv
import os
from pydantic import BaseModel, Field
from typing import Any, Dict
from app.core.config import settings

load_dotenv()

redis_host = os.environ.get("REDIS_SERVER_HOST")

redis_client = redis.Redis(
host=redis_host, port=6379, encoding="UTF-8", decode_responses=True
)

class PublishRequest(BaseModel):
stream: str = Field(default=settings.JOB_STREAM, description="Redis Stream Job name")
payload: Dict[str, Any] No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

์ด ํŒŒ์ผ์€ ์—ฌ๋Ÿฌ ๋ฌธ์ œ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์–ด ๋ณด์ž…๋‹ˆ๋‹ค.

  1. ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ๋‹ค๋ฅธ ๋ถ€๋ถ„์—์„œ๋Š” ๋น„๋™๊ธฐ redis.asyncio๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๋ฐ, ์—ฌ๊ธฐ์„œ๋Š” ๋™๊ธฐ redis.Redis ํด๋ผ์ด์–ธํŠธ๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
  2. settings.JOB_STREAM์„ ์‚ฌ์šฉํ•˜๋ ค ํ•˜์ง€๋งŒ, app/core/config.py์—๋Š” STREAM_JOB์œผ๋กœ ์ •์˜๋˜์–ด ์žˆ์–ด AttributeError๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.
  3. Redis ํ˜ธ์ŠคํŠธ๋ฅผ REDIS_SERVER_HOST ํ™˜๊ฒฝ ๋ณ€์ˆ˜์—์„œ ๊ฐ€์ ธ์˜ค๋Š”๋ฐ, config.py์—์„œ๋Š” REDIS_URL์„ ์‚ฌ์šฉํ•˜๋ฏ€๋กœ ์„ค์ •์ด ์ผ๊ด€๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ด ํŒŒ์ผ์ด ํ˜„์žฌ ํ”„๋กœ์ ํŠธ์—์„œ ์‚ฌ์šฉ๋˜์ง€ ์•Š๋Š”๋‹ค๋ฉด ํ˜ผ๋ž€์„ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด ์ œ๊ฑฐํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ๋งŒ์•ฝ ์‚ฌ์šฉ๋˜๋Š” ํŒŒ์ผ์ด๋ผ๋ฉด ์œ„ ๋ฌธ์ œ๋“ค์„ ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

Comment on lines +17 to +24
correlationId=correlationId,
presignedUrl=job_request.presigned_url,
replyQueue=settings.STREAM_RESULT,
callbackUrl=None,
contentType="image/jpeg",
createdAt=datetime.utcnow().isoformat(),
ttlSec=3600,
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

contentType๊ณผ ttlSec ๊ฐ’์ด ํ•˜๋“œ์ฝ”๋”ฉ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. contentType์€ ํด๋ผ์ด์–ธํŠธ ์š”์ฒญ์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ JobRequest์— ํฌํ•จํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ttlSec ๊ฐ’์€ app/core/config.py์˜ settings์—์„œ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒƒ์ด ์œ ์ง€๋ณด์ˆ˜์— ๋” ์šฉ์ดํ•ฉ๋‹ˆ๋‹ค.

Comment on lines +14 to +21
class ImageJob(BaseModel):
correlationId: str
presignedUrl: str
replyQueue: str
callbackUrl: str | None = None
contentType: str
createdAt: str
ttlSec: int

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

ImageJob ๋ชจ๋ธ์˜ ํ•„๋“œ๋ช…(correlationId, presignedUrl ๋“ฑ)์ด camelCase๋กœ ์ž‘์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. Python์—์„œ๋Š” PEP 8 ์Šคํƒ€์ผ ๊ฐ€์ด๋“œ์— ๋”ฐ๋ผ snake_case (correlation_id, presigned_url) ์‚ฌ์šฉ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. ์ฝ”๋“œ ์ „์ฒด์˜ ์ผ๊ด€์„ฑ์„ ์œ„ํ•ด snake_case๋กœ ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒƒ์„ ๊ณ ๋ คํ•ด ๋ณด์„ธ์š”. ์ด ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์ ์šฉํ•˜๋ฉด ์ด ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜๋Š” ๋‹ค๋ฅธ ์ฝ”๋“œ๋„ ํ•จ๊ป˜ ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

Suggested change
class ImageJob(BaseModel):
correlationId: str
presignedUrl: str
replyQueue: str
callbackUrl: str | None = None
contentType: str
createdAt: str
ttlSec: int
class ImageJob(BaseModel):
correlation_id: str
presigned_url: str
reply_queue: str
callback_url: str | None = None
content_type: str
created_at: str
ttl_sec: int



HERE = Path(__file__).resolve().parent.parent
MODEL_PATH = HERE / "models" / "models" / "best_model_0823.pt"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

๋ชจ๋ธ ๊ฒฝ๋กœ์— models๊ฐ€ ์ค‘๋ณต์œผ๋กœ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค (HERE / "models" / "models" / ...). ์ด๋Š” ์˜คํƒ€์ผ ๊ฐ€๋Šฅ์„ฑ์ด ์žˆ์œผ๋ฉฐ, ์‹ค์ œ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ์™€ ์ผ์น˜ํ•˜๋Š”์ง€ ํ™•์ธ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์˜๋„๋œ ๊ฒƒ์ด ์•„๋‹ˆ๋ผ๋ฉด ๊ฒฝ๋กœ๋ฅผ ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

Suggested change
MODEL_PATH = HERE / "models" / "models" / "best_model_0823.pt"
MODEL_PATH = HERE / "models" / "best_model_0823.pt"

print(f"[task] Image scan finished for job_id={correlation_id}")

except Exception as e:
print(f"[task] Failed to process job_id={correlation_id}: {e}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

print ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋กœ๊ทธ๋ฅผ ๋‚จ๊ธฐ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. Python์˜ logging ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•˜๋ฉด ๋กœ๊ทธ ๋ ˆ๋ฒจ(DEBUG, INFO, ERROR ๋“ฑ)์— ๋”ฐ๋ฅธ ์ œ์–ด, ๋กœ๊ทธ ํฌ๋งทํŒ…, ํŒŒ์ผ ๋˜๋Š” ์™ธ๋ถ€ ์„œ๋น„์Šค๋กœ์˜ ๋กœ๊ทธ ์ „์†ก ๋“ฑ ๋” ์œ ์—ฐํ•˜๊ณ  ๊ฐ•๋ ฅํ•œ ๋กœ๊น…์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. logging ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•˜๋„๋ก ๋ฆฌํŒฉํ† ๋งํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

self.redis_client = redis_client

async def run(self):
print(f"[worker] start consumer={settings.CONSUMER_NAME} group={settings.GROUP_NAME} stream={settings.STREAM_JOB}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

print ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋กœ๊ทธ๋ฅผ ๋‚จ๊ธฐ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. Python์˜ logging ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•˜๋ฉด ๋กœ๊ทธ ๋ ˆ๋ฒจ(DEBUG, INFO, ERROR ๋“ฑ)์— ๋”ฐ๋ฅธ ์ œ์–ด, ๋กœ๊ทธ ํฌ๋งทํŒ…, ํŒŒ์ผ ๋˜๋Š” ์™ธ๋ถ€ ์„œ๋น„์Šค๋กœ์˜ ๋กœ๊ทธ ์ „์†ก ๋“ฑ ๋” ์œ ์—ฐํ•˜๊ณ  ๊ฐ•๋ ฅํ•œ ๋กœ๊น…์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. logging ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•˜๋„๋ก ๋ฆฌํŒฉํ† ๋งํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant